package fever.utils.reflect 
{

	/**
	 * Method parameters informations.
	 * 
	 * @see fever.utils.reflect.ClassInfo	 * @see fever.utils.reflect.MethodInfo
	 * 
	 * @author Romain Ecarnot
	 */
	public class ParameterInfo extends ElementInfo
	{
		//--------------------------------------------------------------------
		// Private properties
		//--------------------------------------------------------------------
		
		private var _index : int;		private var _optional : Boolean;
		
				
		//--------------------------------------------------------------------
		// Public properties
		//--------------------------------------------------------------------
		
		/** Static flag is not available for parameter elements. */
		override public function get staticFlag( ) : Boolean { return _static; }
		
		/** <code>true</code> if parameter is optional.*/
		public function get optionalFlag( ) : Boolean { return _optional; }
		
		/** Parameter index in method signature.*/
		public function get index( ) : int { return _index; }
		
		
		//--------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------
		
		/**
		 * Constructor.
		 * 
		 * @param eDesc XML Node description
		 */
		public function ParameterInfo( eDesc : XML )
		{
			super( eDesc, "", eDesc.@type );
			
			_index = parseInt( eDesc.@index );			_optional = eDesc.@optional;
			_name = "arg" + _index;
		}
		
		/** 
		 * @inheritDoc
		 */
		override public function toString() : String
		{
			return ( name + " : " + type );
		}
	}
}
